﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Web.Http;
using System.Web.Mvc;
using Leffaetsin.Models;
using Leffaetsin.Services;
using Leffaetsin.Services.Providers.IMDBProviders;
using RestSharp;

namespace Leffaetsin.Controllers
{
    public class MoviesController : ApiController
    {
        //[OutputCache(Duration = 3600, VaryByParam = "id")]
        public IEnumerable<Movie> GetMovies(string id = "Helsinki")
        {
            return MovieService.GetMovies(id);
        }

        //[OutputCache(Duration = 3600, VaryByParam = "id;areaName")]
        public Movie GetMovie(string name, string areaName)
        {
            return MovieService.GetMovie(name, areaName);
        }

        [OutputCache(Duration = 3600, VaryByParam = "name;year")]
        public item GetImdbMovie(string name, string year)
        {
            return ImdbApiProvider.GetImdbApiMovie(name, year);
        }
    }
}
